package com.beteng.su.betengsu.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.beteng.su.betengsu.R;
import com.beteng.su.betengsu.base.BaseActivity;
import com.beteng.su.betengsu.bean.UpdataBean;
import com.beteng.su.betengsu.net.webservice.SiteService;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;

/**
 * Created by chenzhimin on 2017/9/5.
 */

public class SplashActivity extends BaseActivity {
    @Override
    public void initData(Bundle savedInstanceState) {
        checkVersion();
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_splash;
    }

    public void checkVersion() {

//        SiteService.getInstants().getVersion(this)
//                .observeOn(AndroidSchedulers.mainThread())
//                .subscribe(new Consumer<UpdataBean>() {
//                    @Override
//                    public void accept(UpdataBean updataBean) throws Exception {
//                        LoginActivity.start(SplashActivity.this);
//                    }
//                });

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                LoginActivity.start(SplashActivity.this);
                finish();
            }
        },2000);

    }
}
